# -*- coding:utf-8 -*-


"""
@version: v1.0
@author: 夏伟坤
@Email: 915624876@qq.com
@software: PyCharm
@project: CXX_UploadFile
@file: db_redis.py
@time: 2021/10/29 15:37
"""
import json

import redis
from conf import setting

r1 = redis.Redis(host=setting.IP, port=setting.PORT, db=1)  # 申请流水表
r2 = redis.Redis(host=setting.IP, port=setting.PORT, db=2)  # 申请流水完成表
r3 = redis.Redis(host=setting.IP, port=setting.PORT, db=3)  # 上传文件描述表

# import uuid
#
# uuid_ = str(uuid.uuid1())
# data = {'filename': 'filename', 'filesize': 'filesize', 'filepath': 'filepath',
#         'status': 'FileStatus.waiting_upload'}
# r3.set(uuid_, data)
# print(r3.get(uuid_).decode())
# print(type(r3.get(uuid_)))
if __name__ == '__main__':
    data = r3.hgetall('a158a234-38ef-11ec-9495-4c796e5c5d86')
    size = r3.hget('a158a234-38ef-11ec-9495-4c796e5c5d86','size')
    print(size.decode())

